package pl.edu.agh.logview.model.helper;

import pl.edu.agh.logview.model.State;
import pl.edu.agh.logview.webservice.MessageBeanImpl;

/**
 * Pomocnicza klasa do operacji na przychodzących stanach
 * @author maciek
 *
 */
public class StateHelper {

	private AgentHelper agentHelper;
	
	public StateHelper(){
		agentHelper = new AgentHelper();
	}

	public State buildState(MessageBeanImpl messageBean){
		State state = new State();
		
		state.setAgent(agentHelper.buildAgent(messageBean.getFromAgent()));
		state.setName(messageBean.getMessageContent());
		state.setActionTime(messageBean.getTime());		
		
		return state;
	}
}
